/*
  素材（图片）相关接口
*/
import $axios from '@/utils/request'
/**
 * @description: 获取用户图片素材
 * @param {*} 是否收藏和页码
 * @return {*}
 */
export const userImg = data => {
  return $axios({
    url: '/mp/v1_0/user/images',
    method: 'GET',
    params: data
  })
}

/**
 * @description: 收藏图片素材
 * @param {*} collect 是否收藏，false-取消收藏，true-添加收藏
 * @return {*}
 */
export const collectImg = data => {
  return $axios({
    url: `/mp/v1_0/user/images/${data.id}`,
    method: 'PUT',
    data
  })
}

/**
 * @description: 删除图片素材
 * @param {*} 图片的id
 * @return {*}
 */
export const removeImg = data => {
  return $axios({
    url: `/mp/v1_0/user/images/${data.id}`,
    method: 'DELETE'
  })
}
